exports.parseFilePath = function (path) {
  console.info('文件处理path', path)
  let file = {
    file_name: '',
    file_path: '',
    suffix: ''
  }
  file.file_name = path.substring(path.lastIndexOf('\\') + 1, path.lastIndexOf('.'))
  file.suffix = path.substring(path.lastIndexOf('.') + 1)
  file.file_path = path
  return file
}

exports.initParam = function () {
  const fs = require('fs')
  try {
    let configPath = require('path').join(process.cwd(), '../dev_flag')
    if (!fs.existsSync(configPath)) {
      console.info('写入配置')
      fs.writeFileSync(configPath, 'no')
    } else {
      console.info('文件已存在')
    }
  } catch (e) {
    console.log('读取文件发生错误')
  }
}
